/**
 * 自定义确认对话框样式
 * 仿照Element UI的MessageBox样式
 */

/* 确认框容器 */
.custom-confirm-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2000;
}

/* 遮罩层 */
.custom-confirm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: auto;
}

.custom-confirm-overlay.show {
    opacity: 1;
    visibility: visible;
}

.custom-confirm-overlay.closing {
    opacity: 0;
    visibility: hidden;
}

/* 确认框主体 */
.custom-confirm {
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 420px;
    max-width: 500px;
    transform: scale(0.7);
    transition: transform 0.3s ease;
    position: relative;
}

.custom-confirm-overlay.show .custom-confirm {
    transform: scale(1);
}

.custom-confirm.center {
    text-align: center;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .custom-confirm {
        min-width: 300px;
        max-width: 90vw;
        margin: 0 20px;
    }
}

/* 头部 */
.custom-confirm-header {
    padding: 20px 20px 10px;
    position: relative;
    border-bottom: 1px solid #ebeef5;
}

.custom-confirm-title {
    font-size: 18px;
    font-weight: 500;
    color: #303133;
    line-height: 1;
    margin: 0;
}

.custom-confirm-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    font-size: 20px;
    color: #909399;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.custom-confirm-close:hover {
    color: #409eff;
}

/* 内容区域 */
.custom-confirm-body {
    padding: 20px;
}

.custom-confirm-content {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.custom-confirm.center .custom-confirm-content {
    flex-direction: column;
    align-items: center;
    text-align: center;
}

/* 图标 */
.custom-confirm-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: bold;
    color: #fff;
    flex-shrink: 0;
}

.custom-confirm.info .custom-confirm-icon {
    background-color: #409eff;
}

.custom-confirm.success .custom-confirm-icon {
    background-color: #67c23a;
}

.custom-confirm.warning .custom-confirm-icon {
    background-color: #e6a23c;
}

.custom-confirm.error .custom-confirm-icon {
    background-color: #f56c6c;
}

/* 消息内容 */
.custom-confirm-message {
    font-size: 14px;
    color: #606266;
    line-height: 1.5;
    flex: 1;
    word-break: break-word;
}

.custom-confirm.center .custom-confirm-message {
    margin-top: 8px;
}

/* 底部按钮区域 */
.custom-confirm-footer {
    padding: 10px 20px 20px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.custom-confirm.center .custom-confirm-footer {
    justify-content: center;
}

/* 按钮样式 */
.custom-confirm-btn {
    padding: 8px 16px;
    border-radius: 4px;
    border: 1px solid #dcdfe6;
    background: #fff;
    color: #606266;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 80px;
    outline: none;
}

.custom-confirm-btn:hover {
    color: #409eff;
    border-color: #c6e2ff;
    background-color: #ecf5ff;
}

.custom-confirm-btn:active {
    transform: translateY(1px);
}

/* 取消按钮 */
.custom-confirm-btn.cancel {
    margin-right: 10px;
}

.custom-confirm-btn.cancel:hover {
    color: #606266;
    border-color: #c0c4cc;
    background-color: #f5f7fa;
}

/* 确认按钮 - 不同类型 */
.custom-confirm-btn.confirm {
    color: #fff;
    border-color: #409eff;
    background-color: #409eff;
}

.custom-confirm-btn.confirm:hover {
    background-color: #66b1ff;
    border-color: #66b1ff;
}

.custom-confirm-btn.confirm.success {
    background-color: #67c23a;
    border-color: #67c23a;
}

.custom-confirm-btn.confirm.success:hover {
    background-color: #85ce61;
    border-color: #85ce61;
}

.custom-confirm-btn.confirm.warning {
    background-color: #e6a23c;
    border-color: #e6a23c;
}

.custom-confirm-btn.confirm.warning:hover {
    background-color: #ebb563;
    border-color: #ebb563;
}

.custom-confirm-btn.confirm.error {
    background-color: #f56c6c;
    border-color: #f56c6c;
}

.custom-confirm-btn.confirm.error:hover {
    background-color: #f78989;
    border-color: #f78989;
}

/* 圆角按钮 */
.custom-confirm-btn.round {
    border-radius: 20px;
    padding: 8px 20px;
}

/* 加载状态 */
.custom-confirm-btn.loading {
    position: relative;
    pointer-events: none;
}

.custom-confirm-btn.loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 14px;
    height: 14px;
    margin: -7px 0 0 -7px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: custom-confirm-spin 1s linear infinite;
}

@keyframes custom-confirm-spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* 禁用状态 */
.custom-confirm-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.custom-confirm-btn:disabled:hover {
    transform: none;
}

/* 暗色主题支持 */
@media (prefers-color-scheme: dark) {
    .custom-confirm {
        background: #2d2d2d;
        color: #e4e7ed;
    }
    
    .custom-confirm-header {
        border-bottom-color: #4c4d4f;
    }
    
    .custom-confirm-title {
        color: #e4e7ed;
    }
    
    .custom-confirm-message {
        color: #c0c4cc;
    }
    
    .custom-confirm-btn {
        background: #3a3a3a;
        border-color: #4c4d4f;
        color: #c0c4cc;
    }
    
    .custom-confirm-btn:hover {
        background: #404040;
        border-color: #606266;
    }
}

/* 动画增强 */
.custom-confirm-overlay {
    backdrop-filter: blur(2px);
}

.custom-confirm {
    animation: custom-confirm-bounce-in 0.3s ease-out;
}

@keyframes custom-confirm-bounce-in {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }
    50% {
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.custom-confirm-overlay.closing .custom-confirm {
    animation: custom-confirm-zoom-out 0.3s ease-in;
}

@keyframes custom-confirm-zoom-out {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(0.3);
        opacity: 0;
    }
}